<template>
  <div>
    <el-menu
      :default-active="activeIndex"
      class="el-menu-demo"
      mode="horizontal"
      @select="handleSelect"
      background-color="#304156"
      text-color="#fff"
      active-text-color="#ffd04b"
    >
      <el-menu-item index="0" >课题管理</el-menu-item>
      <el-menu-item index="1" >中心管理</el-menu-item>
      <el-menu-item index="2" >账户管理</el-menu-item>

    </el-menu>
  </div>
</template>
<script>
import myUtils from '../../api/myUtils'
export default {
  //数据监控，设备管理，任务信息，受试者列表，文件列表
  props:{
    activeIndex:{
      type:String,
      default:'0'
    },
  },
  created() {

    let role = myUtils.getRole(this.$route.query.subjectPkId, this.$store.getters.roles);
    if(role == 1 || role == 3 || role == 5 || role == 7)
    {

      this.notCollector = false;

    }

  },
  data(){
    return{
      position:'1',
      notCollector:true


    }
  },
  methods: {
    handleSelect(key, keyPath) {
      if(key==='0')
      {
        this.$router.push({path:`/upload/research-admin?subjectPkId=${this.$route.query.subjectPkId}`})
       // this.$router.push({path:`/upload/file-list?subjectPkId=${this.$route.query.subjectPkId}`})
      }
      if(key==='1')
      {
        this.$router.push({path:`/upload/site-admin?subjectPkId=${this.$route.query.subjectPkId}`})
        // this.$router.push(0)
       // this.$router.push({path:`/upload/research-manager?subjectPkId=${this.$route.query.subjectPkId}`})
      }
      else if(key==='2')
      {
        this.$router.push({path:`/upload/user-admin?subjectPkId=${this.$route.query.subjectPkId}`})
      }
    }

  }
}
</script>
